function img_rand_adcode() { img_ad_html = ''; if ( jQuery(window).width() <= 767 ) { var adsize = '[[300, 50], [320, 50]]'; img_ad_html = '
'; } else { var adsize = '[[300, 100], [300, 50], [468, 60], [320, 50], [550, 100]]'; img_ad_html = '
'; } io_css = ''; if( jQuery(window).width() <= 330 ) { io_css = 'margin:0 -20px'; } //ad300x250 if ( jQuery(window).width() <= 767 ) { img_ad_html += '
var googletag = googletag || {};googletag.cmd = googletag.cmd || [];googletag.cmd.push(function() {slot = googletag.defineSlot("/1050432/www.financialexpress.com/FE_Mobile_IMAGE_OVERLAY", '+ adsize +', "div-gpt-ad-1567079617034-0").addService(googletag.pubads());googletag.pubads().enableSingleRequest();googletag.pubads().collapseEmptyDivs(); googletag.enableServices();googletag.display("div-gpt-ad-1567079617034-0");googletag.pubads().refresh([slot]);});
'; } else { img_ad_html += '
var googletag = googletag || {};googletag.cmd = googletag.cmd || [];googletag.cmd.push(function() {slot = googletag.defineSlot("/1050432/www.financialexpress.com/FE_Desktop_IMAGE_OVERLAY", '+ adsize +', "div-gpt-ad-1567146677530-0").addService(googletag.pubads());googletag.pubads().enableSingleRequest();googletag.pubads().collapseEmptyDivs(); googletag.enableServices();googletag.display("div-gpt-ad-1567146677530-0");googletag.pubads().refresh([slot]);});
'; } return img_ad_html; } function img_generate_ad( afterad ) { try{ var cmnter = 0; jQuery( 'div.article-image, .imgwrapper, .main-story-content' ).each( function() { if ( 1 == cmnter ) { return false; } jQuery( this ).find( 'img' ).each( function() { if ( jQuery( this ).next( '.imghalder' ).html() == undefined ) { getadcode = img_rand_adcode(); jQuery( getadcode ).insertAfter( this ); jQuery( '#inhouseimg' ).css( "width", jQuery( this ).width() ); if( jQuery( '.io-code-box' ).html() != undefined && ! jQuery( '.io-code-box' ).attr( 'style' ).match( 'none' ) ) { var tu = setTimeout( function() { var imgclose = '1px'; if( jQuery( document ).width() <= 330 ) { imgclose = '0'; } jQuery( '.io-code-box > div' ).prepend( 'X' ); var ti = setTimeout( function() { jQuery( '.imgclose' ).on( 'click', function() { jQuery( '#inhouseimg' ).remove(); }); },1000); }, 4000 ); } cmnter++; } }); }); jQuery(window).on("orientationchange",function(){ var tu = setTimeout( function(){ jQuery( 'div.article-image, .imgwrapper' ).each( function() { jQuery( '#inhouseimg' ).css( "width", jQuery( this ).width() ); }); }, 1000 ); }); jQuery( 'div.article-image, .imgwrapper' ).each( function() { if ( jQuery( this ).attr( 'itemprop' ) == 'articleBody' || jQuery( this ).hasClass( 'article-caption' ) ) { jQuery( this ).find( 'img' ).each( function() { //alert(jQuery( this ).next( '.imghalder' ).html()); if ( jQuery( this ).next( '.imghalder' ).html() == undefined ) { getadcode = img_rand_adcode(); jQuery( getadcode ).insertAfter( this ); jQuery( '#inhouseimg' ).css( "width", jQuery( this ).width() ); cmnter++; } }); } }); } catch(err) {} } jQuery(window).load(function(){ img_generate_ad(); if(jQuery(this).width() <= 767){ jQuery('.article-image .size-full, .main-story-content .size-full').css('float', 'none'); } });